//
//  TravelsTableViewCell.m
//  SLYTravel
//
//  Created by lanou3g on 16/5/18.
//  Copyright © 2016年 锁腾飞. All rights reserved.
//

#import "TravelsTableViewCell.h"

#import "TravelsCollectionViewCell.h"

static NSString *TRAVEL_COLLECTION_IDENTIFIER = @"TravelsCollectionViewCell";

@interface TravelsTableViewCell ()<UICollectionViewDelegate, UICollectionViewDataSource>

@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *nickName;
@property (weak, nonatomic) IBOutlet UIButton *fromReferee;
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;

@end

@implementation TravelsTableViewCell

- (void)awakeFromNib {
    // Initialization code
    _iconImageView.layer.cornerRadius = _iconImageView.size.width / 2.0;
    _iconImageView.backgroundColor = [UIColor redColor];
    _iconImageView.layer.masksToBounds = YES;
    [self createCollectionView];
    
}

/**
 *  创建 CollectionView
 */
- (void)createCollectionView {
    self.collectionView.dataSource = self;
    self.collectionView.delegate = self;
    [self.collectionView registerNib:[UINib nibWithNibName:@"TravelsCollectionViewCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:TRAVEL_COLLECTION_IDENTIFIER];
    [self.contentView addSubview:self.collectionView];
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return 8;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    TravelsCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:TRAVEL_COLLECTION_IDENTIFIER forIndexPath:indexPath];
    return cell;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
